﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.EntitiesBLL
{
    public class HocvienBLL
    {
        public string AddID(string id)
        {
            string s = id.Trim();
            int len = s.Length;
            string con = s.Substring(2);
            string kq = s.Substring(0, 2);
            int so = Convert.ToInt32(con) + 1;
            if (so <= 9)
                kq += '0';
            kq += so;

            return kq;
        }

        /// <summary>
        /// Mã tự sinh
        /// </summary>
        /// <param name="id"></param>
        /// <returns> id++ </returns>
        public string AddID(string id, string id2)
        {
            string s = id.Trim(); 
            string s2 = id2.Trim();
            string chuoi = "K";

            string chuoi_khoa = s.Substring(4);
            chuoi += chuoi_khoa; 
            chuoi += "HV";

            string chuoi_hv = s2.Substring(5);
            int so = Convert.ToInt32(chuoi_hv) + 1;
            if (so <= 9)
                chuoi += '0';

            chuoi += so;

            return chuoi;
        }

    }
}
